/**
 * test if a path is an external path (starts with http(s)://, mailto: or tel:)
 *
 * @param path: the path to test
 * @returns: wheather it's an external path
 */
export const isExternal = (path: string): boolean => {
  return /^(https?:\/\/|mailto:|tel:)/.test(path);
};

/**
 * test if an url is http or https
 *
 * @param url: the url to test
 * @returns: true if url is http or https, false otherwise
 */
export const isHttp = (url: string): boolean => {
  return url.indexOf('http://') !== -1 || url.indexOf('https://') !== -1;
};

export const isNotEmpty3 = (value: any): boolean => {
  return value !== null && value !== '' && typeof value !== 'undefined';
}
